<?php $this->_extends('_layouts/cib_layout'); ?>

<?php $this->_block('metainfo'); ?>
    <title><?=$teacher->name;?> —— 课件下载系统 —— 师资队伍 —— 上海外国语大学国际工商管理学院</title>
    <meta name="Description" content="上海外国语大学国际工商管理学院,SISUCIB,师资队伍,课件下载系统，<?=$teacher->name;?>" />
    <meta name="Keywords"    content="上海外国语大学国际工商管理学院,SISUCIB,师资队伍,课件下载系统，<?=$teacher->name;?>" />
    <link rel="stylesheet" type="text/css" href="profiles/<?=Q::ini('appini/skin');?>/cib-faculty.css" />
    <style type="text/css" media="all"><?=$css;?></style>
<?php $this->_endblock('metainfo'); ?>

<?php $this->_block('container'); ?>
<div id="container">
    <?php $this->_element('g-pieces/faculty/g-pieces-faculty-column-a'); ?>

    <div id="content">
        <h2>课件下载系统--<b><?=$teacher->name;?></b>老师</h2>

        <?php if($flag < 1) { ?>
        <div id="course-gate">
            <h3>(<?=Course::find('course_id = ?', $Gcourse_id)->query()->course;?>)的课件</h3>
            <?php if($flag == 0) { ?>
                <p>课程密钥错误，请向任课教师咨询</p>
            <?php } ?>
            <form action="<?=url('faculty/facultygarden', array('teacher_id'=>$_GET['teacher_id']));?>" method="post">
                <div>
                    <label for="code"><b>请输入课程的密钥：</b></label>
                    <input type="password" name="code" value="" id="code" /><br />
                    <input type="submit" value="提交" />
                </div>
            </form>
        </div><!-- /course-gate -->
        <?php } ?>

        <?php if($flag == 1) { ?>
        <div id="course-gate">
            <h3>(<?=Course::find('course_id = ?', $Gcourse_id)->query()->course;?>)的课件如下：</h3>
            <div class="tz369">
                <h2>课件</h2>
                <table>
                    <tr>
                        <th class="filename">课件名</th>
                        <th class="size">大小</th>
                        <th class="date">时间</th>
                        <th class="downloadurl">时间</th>
                    </tr>
                    <?php if(isset($tdocs) && !$tdocs->isEmpty()) { ?>
                        <?php foreach($tdocs as $key => $tdoc) { ?>
                        <tr>
                            <td class="filename">
                            <?=$key+1;?>. <a href="<?=url('Utility/Download', array('id'=>$tdoc->tdoc_id, 'mode'=>'tdoc'));?>">
                            <?=$tdoc->filename;?></a></td>
                            <td class="size"><?=$tdoc->size;?></td>
                            <td class="date"><?=date('Y-m-d', $tdoc->created);?></td>
                            <td class="downloadurl">
                                <a href="<?=url('Utility/Download', array('id'=>$tdoc->tdoc_id, 'mode'=>'tdoc'));?>">下载</a>
                            </td>
                        </tr>
                        <?php } ?>
                    <?php } else { ?>
                        <tr>
                            <td colspan="4" class="nodata">暂无该课程的课件</td>
                        </tr>
                    <?php } ?>
                </table>
            </div>
        </div><!-- /course-gate -->
        <?php } ?>

        <div id="course-list">
            <h3><?=$teacher->name;?>老师开设的课程</h3>
            <ul class="tz">
                <?php foreach($teacher->courses as $tc) { ?>
                <li>
                    <a href="<?=url('faculty/facultygarden', array('teacher_id'=>$_GET['teacher_id'], 'course_id'=>$tc->course_id));?>"><?= $tc->course;?></a>
                </li>
                <?php } ?>
                <li>&nbsp;</li>
                <li><a href="<?=url('faculty/facultylist');?>">返回教师列表 >></a></li>
            </ul>
        </div><!-- /course-list -->
    </div><!-- /content -->

    <?php $this->_element('g-pieces/faculty/g-pieces-faculty-column-b'); ?>
</div><!-- /container-->

<?php $this->_endblock('container'); ?>